package com.naholyr.android.diigo;

import java.util.Set;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.widget.EditText;
import android.widget.TextView.SavedState;

public class Add extends Activity {
	
	EditText mUrl;
	EditText mTitle;
	
	/**
	 * @see android.app.Activity#onCreate(Bundle)
	 */
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.add);
		
		mUrl = (EditText) findViewById(R.id.input_url);
		mTitle = (EditText) findViewById(R.id.input_title);

        Intent intent = getIntent();
        String action = intent.getAction();
        //Uri data = intent.getData();
        //String type = intent.getType();
        
        Bundle bundle = intent.getExtras();
        String txt = "";
		Set<String> keys = bundle.keySet();
		for (String key : keys) {
			txt += key+"="+bundle.get(key).toString()+", ";
		}
        
        mUrl.setText(action);
        mTitle.setText(txt);
        /*
        if (Intent.ACTION_INSERT.equals(action)
                        && Browser.BOOKMARKS_URI.equals(data)) {
                String url = intent.getStringExtra("url");
                String title = intent.getStringExtra("title");
                mEditUrl.setText(url);
                mEditTitle.setText(title);
        } else if (Intent.ACTION_SEND.equals(action)
                        && "text/plain".equals(type)) {
                String url = intent.getStringExtra(Intent.EXTRA_TEXT);
                mEditUrl.setText(url);
        } else {
                // For debugging
                mEditUrl.setText("http://www.youtube.com/");
                mEditTitle.setText("");
        }
		*/
	}

}
